<% @title = t(".api_key_roles") %>
<div class="t-body">
  <p>
    <%= button_to(t(".new_role"), new_profile_oidc_api_key_role_path, method: "get", class: "form__submit") %>
  </p>
  <header class="gems__header push--s">
    <p class="gems__meter l-mb-0"><%= page_entries_info(@api_key_roles) %></p>
  </header>
  <table class="owners__table">
    <thead>
      <tr class="owners__row owners__header">
        <th class="owners__cell">
          <%= OIDC::ApiKeyRole.human_attribute_name(:name) %>
        </th>
        <th class="owners__cell">
          <%= OIDC::ApiKeyRole.human_attribute_name(:token) %>
        </th>
        <th class="owners__cell">
          <%= OIDC::Provider.human_attribute_name(:issuer) %>
        </th>
      </tr>
    </thead>
    <tbody class="t-body">
      <% @api_key_roles.each do |api_key_role| %>
        <tr class="owners__row">
          <td class="owners__cell" data-title="Name">
            <%= link_to api_key_role.name, profile_oidc_api_key_role_path(api_key_role.token) %>
          </td>
          <td class="owners__cell " data-title="Role Token">
            <code><%= api_key_role.token %></code>
          </td>
          <td class="owners__cell" data-title="Provider">
            <%= link_to api_key_role.provider.issuer, profile_oidc_provider_path(api_key_role.provider) %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
  <%= paginate @api_key_roles %>
</div>
